/*
 * Filename    : Text_Load.java
 * Projectname : Sound Of Indonesia
 * Date        : Nov 2, 2012 , 12:51:06 AM 
 * 
 * PratamaNurWijaya
 */

package id.pratama.soundofindonesia.text;

import org.andengine.engine.camera.hud.HUD;
import org.andengine.entity.scene.Scene;
import org.andengine.opengl.font.Font;
import org.andengine.opengl.font.FontFactory;
import org.andengine.opengl.font.FontManager;
import org.andengine.opengl.texture.TextureManager;
import org.andengine.opengl.vbo.VertexBufferObjectManager;
import org.andengine.ui.activity.BaseGameActivity;

import android.content.Context;
import android.content.res.AssetManager;

import id.pratama.soundofindonesia.Utils;
import id.pratama.soundofindonesia.apps.Apps_Data;
import id.pratama.soundofindonesia.graphic.Graphic_Detach;

public class Text_Load implements Text_Data, Text_Define, Text_Path, Apps_Data
{
	protected BaseGameActivity	activity;
	protected Scene				m_Scene;
	protected HUD				m_Hud;
	protected Graphic_Detach	grafik;

	public Font					fnt_Small, fnt_Medium, fnt_Big;

	public Text_Load(Context con, Scene scene, HUD hud, Graphic_Detach graf)
	{
		activity = (BaseGameActivity) con;
		m_Scene = scene;
		m_Hud = hud;
		grafik = graf;
	}

	protected TextureManager getTextMan()
	{
		return activity.getTextureManager();
	}

	protected FontManager getFontMan()
	{
		return activity.getFontManager();
	}

	protected AssetManager getAssetMan()
	{
		return activity.getAssets();
	}

	protected VertexBufferObjectManager getVertex()
	{
		return activity.getVertexBufferObjectManager();
	}

	public void loadFontSmall()
	{
		if (fnt_Small != null)
			return;

		Utils.TRACE("Load Font Small");
		fnt_Small = FontFactory.createFromAsset(getFontMan(), getTextMan(), TEX_TEXT_WIDTH, TEX_TEXT_HEIGHT,
				getAssetMan(), FONT_USE, FONT_SIZE_SMALL, true, android.graphics.Color.BLACK);
		fnt_Small.load();

	}

	public void loadFontMedium()
	{
		if (fnt_Medium != null)
			return;
		Utils.TRACE("Load Font Medium");
		fnt_Medium = FontFactory.createFromAsset(getFontMan(), getTextMan(), TEX_TEXT_WIDTH, TEX_TEXT_HEIGHT,
				getAssetMan(), FONT_USE, FONT_SIZE_MEDIUM, true, android.graphics.Color.BLACK);
		fnt_Medium.load();
	}

	public void loadFontBig()
	{
		if (fnt_Big != null)
			return;
		fnt_Big = FontFactory.createFromAsset(getFontMan(), getTextMan(), TEX_TEXT_WIDTH, TEX_TEXT_HEIGHT,
				getAssetMan(), FONT_USE, FONT_SIZE_BIG, true, android.graphics.Color.BLACK);
		fnt_Big.load();
	}

}
